<%@page import="java.util.List"%>
<%@page import="beans.Student"%>
<%@page import="java.util.ArrayList"%>
<%@page import="beans.StudentDao"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Student</title>
</head>
<body>
	<%
		StudentDao studentDao = new StudentDao();
		ArrayList studentList = studentDao.getStudentList(); 
		
	%>
	<table border="1">
		<!-- <tr>
			<th>ID</th>
			<th>Name</th>
			<th>Gender</th>
		</tr> -->
	<%
		for (int i = 0; i < studentList.size(); i++) {
			Student student = (Student)studentList.get(i);
	%>
		<tr>
			<td><%= student.getId() %></td>
			<td><%= student.getName() %></td>
			<td><%= student.getGender() ? '男' : '女'%></td>
			<td><%= student.getGender() ? '男' : '女'%></td>
		</tr>
	<%
	
			
			/* out.println(student.getId());
			out.println(student.getName());
			out.println(student.getGender()); */
		}
	
	%>
	</table>
	<a href="${pageContext.request.contextPath }/StudentListServlet">列表</a>

</body>
</html>